package io.renren.modules.sp.controller;

import io.renren.common.annotation.LogOperation;
import io.renren.common.annotation.SeasonFilter;
import io.renren.common.constant.Constant;
import io.renren.common.page.PageData;
import io.renren.common.utils.DateUtils;
import io.renren.common.utils.ExcelUtils;
import io.renren.common.utils.Result;
import io.renren.common.validator.AssertUtils;
import io.renren.common.validator.ValidatorUtils;
import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.renren.modules.security.user.UserDetail;
import io.renren.modules.sp.dto.SpMatchDTO;
import io.renren.modules.sp.entity.SpMatchEntity;
import io.renren.modules.sp.entity.TAreaEntity;
import io.renren.modules.sp.excel.SpLeaderExcel;
import io.renren.modules.sp.excel.SpMatchExcel;
import io.renren.modules.sp.service.SpMatchService;
import io.renren.modules.sp.service.TAreaService;
import io.renren.modules.sys.entity.SysUserEntity;
import io.renren.modules.sys.service.SysRoleUserService;
import io.renren.modules.sys.service.SysUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;


/**
* 公共方法
*
* @author whc 15953295779@126.com
* @since 3.0 2023-04-21
*/

public class BaseController {

    /**
     * 判断权限
     * @return
     */
    public boolean authFlag(){
        //获取当前登录用户
        UserDetail user = (UserDetail) SecurityUtils.getSubject().getPrincipal();
        //user.getDeptId() == 1540262983207170050L 高级管理员
        if(user.getDeptId()!=null && user.getDeptId() != 1540262983207170050L) {
            return true;
        }else{
            return false;
        }
    }

}